<template>
  <div class="list-item">
    <div class="item-box">
      <div class="item-left"><img :src="PostImg" /></div>
      <div class="item-right">
        <div class="item-title">{{ t('岗位名称') }}</div>
        <div class="item-form-name">{{ props.item?.name }}</div>
      </div>
      <div class="fixed-checked">
        <slot name="check"></slot>
      </div>
      <div class="fixed-icon">
        <IconFontSymbol icon="post" fill-color="#fdf5ef" />
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
  import PostImg from '/@/assets/workflow/post.png';
  import IconFontSymbol from '/@/components/IconFontSymbol/Index.vue';
  import { useI18n } from '/@/hooks/web/useI18n';
  const { t } = useI18n();
  let props = defineProps({
    item: Object,
  });
</script>

<style lang="less" scoped>
  @custom-color: #ff9935;
  @bg-color: #fffbf7;

  .list-item {
    width: 30%;
    height: 100px;
    background: @bg-color;
    border-color: transparent;
    border-radius: 8px;
    margin-left: 20px;
    margin-bottom: 20px;
    overflow: hidden;

    &:hover {
      border: 1px dotted @custom-color;
    }

    .item-box {
      display: flex;
      margin: 14px;
      position: relative;

      .item-left {
        width: 30%;
        margin-right: 14px;

        img {
          width: 100%;
          height: 100%;
        }
      }

      .item-right {
        .item-title {
          font-size: 12px;
          font-weight: bold;
          color: #999999;
          margin: 10px 0 4px 0;
          opacity: 0.8;
        }

        .item-form-name {
          color: #303133;
          font-size: 14px;
          font-weight: bold;
          opacity: 0.8;
        }
      }

      .fixed-checked {
        position: absolute;
        bottom: -4px;
        z-index: 1;
        right: -6px;
      }

      .fixed-icon {
        position: absolute;
        right: -24px;
        font-size: 70px;
        transform: rotate(48deg);
        top: -24px;
      }
    }
  }

  :deep(.ant-checkbox-inner) {
    border-color: @custom-color;
  }

  :deep(.ant-checkbox-checked .ant-checkbox-inner) {
    background-color: @custom-color;
    border-color: @custom-color;
  }

  :deep(.ant-checkbox-checked::after),
  :deep(.ant-checkbox-wrapper:hover .ant-checkbox-inner, .ant-checkbox:hover),
  :deep(.ant-checkbox-inner),
  :deep(.ant-checkbox:hover),
  :deep(.ant-checkbox-input:focus + .ant-checkbox-inner) {
    border-color: @custom-color;
  }

  .picked {
    border-width: 1px;
    border-style: dotted;
    border-color: @custom-color;
  }

  .not-picked {
    border-width: 1px;
    border-style: dotted;
  }
</style>
